<!DOCTYPE html>
<html lang="ar">
<head>
    <title>الاتفاقيات</title>
	<?php
	 define('LAST_CAPITRE_ID',19);
	 define('LAST_ARTICLE_CODE',3);
	?>

	<?php $this->load->helper('url');?>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta charset="utf-8">

<!---------------------for autocomplete--------------->
	<script type="text/javascript" src="<?php echo base_url('assets/js/jquery-1.11.0.min.js');?>" ></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/jquery-ui-1.10.4/js/jquery-ui-1.10.4.min.js');?>" ></script>
	<link href="<?php echo base_url("assets/css/jquery-ui.css")?>" rel="stylesheet" type="text/css" />
	<!------------------------------------------------------>
<!---------------------for form css ----------------------->
	<link href="<?php echo base_url("assets/css/pure.css")?>" rel="stylesheet" type="text/css" />
	
<script type="text/javascript" src="<?php echo base_url('assets/js/jquery.tablesorter.min.js');?>" ></script>
		<link href="<?php echo base_url("assets/css/table.css")?>" rel="stylesheet" type="text/css" />
	<link href="<?php echo base_url("assets/css/ch_menu.css")?>" rel="stylesheet" type="text/css" />
	 <link href="<?php echo base_url("assets/css/botton.css")?>" rel="stylesheet" type="text/css" />
	
</head>


<?php include_once('header.php');

		//$r=$les_convention;
		 $this->load->library('session');
        $num_ar=$this->session->userdata('data_charticle'); //access it
        $chcl=$num_ar;
		$id_bud=$etat_ch->id;
 ?>
 



<?PHP
 $year=$this->session->userdata('annee');
if(isset($budget_correspond)){
	
echo('<div style="background-color:red;"> التقسيم لا يتطابق مع الاعتماد هناك فرق ب :  '.$budget_correspond.' دينار </div>');

}
?>

<form id="convention_form" class="pure-form pure-form-stacked"  method="POST" action="<?php echo base_url("etat_financier_ctr/valider_modifier_budget_suplementaire/$id_bud");?>">
    
        <legend>تغيير تقسيم الميزانية الاضافية لسنة : <?php echo('<strong>'.$year.'</strong>');?></legend>

        <div class="pure-g">
		 <div class="pure-u-1 pure-u-md-1-3" style="width: 90%">
		    <label style="font-size: 130%; text-decoration: underline; color: red;"> الميزانية الابتدائية</label>
		 </div>
            <div class="pure-u-1 pure-u-md-1-3" style="width: 30%">
                <label for="fournisseur">المبلغ الاولي </label>
				<input id="fournisseur" name="budget" type="text" value="<?php if(isset($budget_modifie)) echo("$budget_modifie"); else echo("$etat_ch->montant_globale");?>">
            </div>
			
			
<?php	
$compt=0;//compteur pour la table des noms de chapitres
for($k=11;$k<20;$k++){
	$num_ch='ch_'.$k;	
	if(isset($saisie)){
		$tt=$saisie[$num_ch];
	}else 	$tt=$etat_ch->$num_ch;
	$d=0;
		echo('		   <div class="pure-u-1 pure-u-md-1-3" style="width: 90%">
		    <label style="font-size: 130%; text-decoration: underline; color: red;"><a href="'.base_url("/etat_financier_ctr/modifier_budget_supl_chapitre/$k").'"> '.$nom_chapitres[$compt]->nom.'</a></label>
			 </div>
         <div class="pure-u-1 pure-u-md-1-3 " style="width: 30%">
                <label for="article">الميزانية المخصصة </label>
                <input  class="ltr" id="montant'.$k.'" name="'.$k.'" type="text" value="'.$tt.'">
            </div>
			
			');
			$compt++;
			}
?>			
		
		 
			
			 </div>
			     <?php
				
  $goupe=$this->session->userdata('user_group'); //access it
if($goupe=="admin"){
echo ('<input type="submit" id="ajouter" value="تحديث"  class="pure-button pure-button-primary" />
	 <a href="'.base_url('/budget_ctr/load/').'" class="pure-button pure-button-primary" >عودة</a>');
}else{
	echo ('<a href="#" class="pure-button-disabled pure-button-primary">تحديث</a>
	 <a href="'.base_url('/budget_ctr/load/').'" class="pure-button pure-button-primary" >عودة</a>');
}
?>
	
		</form>


  <script>
  for (var i = 11; i < 20; i++) {
$('#montant'+i).bind('mouseup keyup focusout focus mousemove',function() {
    $('span.error-rc').hide();
	$(this).css('background-color','pink');
    var inputVal = $(this).val();
    //var characterReg = /^([a-zA-Z0-9]{7,16})$/;
    var characterReg = /^([0-9]+([,]{0,1}[0-9]+){0,1})$/;
    if(!characterReg.test(inputVal)) {
        $(this).after('<span class="error-rc" flag="required" style="color:red;" >حقل غير مطابق للشكل العام </span>');
    }else{
		$(this).css('background-color','#FFFFFF');
	}
});
}
 </script>  


</html>